getfileattributesex (kernel32)
Last changed: Kåre Smith-83.108.28.160

.
Summary

C# Signature:

[DllImport("kernel32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool GetFileAttributesEx(string lpFileName,
   GET_FILEEX_INFO_LEVELS fInfoLevelId, IntPtr lpFileInformation);

Alternative C# Signature:

[DllImport("kernel32.dll", SetLastError=true, CharSet=CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool GetFileAttributesEx(string lpFileName,
  GET_FILEEX_INFO_LEVELS fInfoLevelId, out WIN32_FILE_ATTRIBUTE_DATA fileData);

User-Defined Types:

[GET_FILEEX_INFO_LEVELS]
[WIN32_FILE_ATTRIBUTE_DATA]

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

public static bool GetFileAttributesEx(string lpFileName, out WIN32_FILE_ATTRIBUTE_DATA fileData) {
    return GetFileAttributesEx(lpFileName, GET_FILEEX_INFO_LEVELS.GetFileExInfoStandard,
        out fileData);
}

Alternative Managed API:

Do you know one? Please contribute it!

Documentation